import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        path: '/icon',
        name: 'Icon',
        meta: {
            title: '图标', // 中文标题
            requiresAuth: false, // 无token是否跳转到登录页
            keepAlive: false, // 是否缓存页面（跳转其它页面后是否还可以返回）
            show: true, // 是否显示
            icon: '\ue63b' // 对应图标

        },
        component: () => import('@/views/Icon.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
